def str_reverse(s):
    return s[::-1]

def substr(s,x,y):
    """

    :param s:传入字符串
    :param x: 开始的下标
    :param y: 结束的下标
    :return: 返回切片
    """
    return s[x:y]
if __name__ == '__main__':

    print(str_reverse('hello'))
    print(substr(str_reverse('hello'),2,4))